<template>
    <div class="title_info">
        <img @click="navigateBack" class="info_1" src="../../assets/my/14.png" alt="">
        <div class="info_2">{{ title.title }}</div>
    </div>
</template>

<script name="titleBack" setup>
    import { useRouter } from 'vue-router';
    let router = useRouter();
    let title = defineProps(['title'])
    function navigateBack() {
        window.history.length > 1 ? router.go(-1) : router.push('/')    
    }

    defineExpose({
        navigateBack
    })
</script>

<style lang="scss" scoped>
    .title_info {
        display: flex;
        align-items: center;
        padding: 0 0 12px 0;
        border-bottom: 1px solid #eee;
        .info_1 {
            width: 10px;
            height: 10px;
            cursor: pointer;
        }
        .info_2 {
            font-size: 10px;
            font-weight: 500;
            margin-left: 6px;
        }
    }
</style>